<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>Insert title here</title>
    <link href="https://cdn.bootcss.com/twitter-bootstrap/3.0.1/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <div class="container">
        <div class="row">
            <div class="span12">
                <form class="form-search" action="/good/findtype" method="post">
                    商品名称：<input class="input-medium search-query" type="text" name="goodname" value="" placeholder="商品名称"/>
                    &nbsp&nbsp商品品牌：
                    <select name="goodtype">
                        <option value="">全部</option>
                        <option value="1">蒙牛</option>
                        <option value="2">伊利</option>
                        <option value="3">盼盼</option>
                    </select>
                    <button type="submit" class="btn">查找</button>
                </form>
                <form action="/good/daochu" method="post">
                    <table class="table">
                        <thead>
                        <tr>
                            <th colspan="9">数据列表</th>
                            <th><button type="submit" class="btn">导出</button></th>
                        </tr>
                        <tr>
                            <th> </th>
                            <th>序号</th>
                            <th>商品编码</th>
                            <th>商品名称</th>
                            <th>商品条码</th>
                            <th>品牌</th>
                            <th>规格</th>
                            <th>主库库存</th>
                            <th>车库库存</th>
                            <th>锁定库存</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                            <#list goods as g>
                                <tr class="success">
                                    <td><input type="checkbox" name="ids" value="${g.gid}"> </td>
                                    <td>${g.gid}</td>
                                    <td>${g.commodity.commCode}</td>
                                    <td>${g.commodity.commName}</td>
                                    <td>${g.commodity.commBarCode}</td>
                                    <td>${g.commodity.commBrand.bname}</td>
                                    <td>${g.commodity.packge!''}</td>
                                    <td>${g.znumber}</td>
                                    <td>${g.cnumber}</td>
                                    <td>${g.snumber}</td>
                                    <td>
                                        <a href="/good/detail?gid=${g.gid}">详情</a>
                                        <#--<button class="btn btn-primary" type="button">详情</button>-->
                                    </td>
                                </tr>
                            </#list>
                        </tbody>
                    </table>
                </form>
                <div style="text-align: center">
                    <ul class="pagination">
                        <li>
                            <a href="?pageNum=1">首页</a>
                        </li>
                        <li>
                            <#if page.hasPreviousPage><a href="?pageNum=${page.prePage}">上一页</a>
                            <#else><a href="#">上一页</a></#if>
                        </li>
                        <#list 1..page.pages as p>
                                <#if p==page.pageNum >
                                    <li class="active">
                                    <a href="?pageNum=${p}">${p}</a>
                                    </li>
                                <#else>
                                    <li>
                                    <a href="?pageNum=${p}">${p}</a>
                                    </li>
                                </#if>
                        </#list>
                        <li>
                            <#if page.hasNextPage>
                                <a href="?pageNum=${page.nextPage}">下一页</a>
                            <#else><a href="#">下一页</a></#if>
                        </li>


                        <li>
                            <a href="?pageNum=${page.pages}">最后页</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="modal" id="mymodal">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title">导出提示</h4>
                </div>
                <div class="modal-body">
                    导出成功！
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary">确定</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/2.3.1/js/bootstrap-transition.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/2.3.1/js/bootstrap-modal.js"></script>
    <script>
        $(function(){
            $(".btn").click(function(){
                $("#mymodal").modal("toggle");
            });
        });
        $(function(){
            document.getElementById("checkbox").onclick = function(event){ // 事件发生时，产生的对象
                var checked = event.target.checked; //点击多选框的状态  true选择  false未选择
                var elements = document.getElementsByName("ids");
                for(var i=0;i<elements.length;i++){
                    elements[i].checked = checked;
                }
            }
        })
    </script>
</body>
</html>